
function SendErrorMessageToPlayerChat(player, text)
	local rp = RecipientFilter()
	rp:AddPlayer(player)
 
	umsg.Start("inv_chatprinterror", rp)
		umsg.String(text)
	umsg.End()
end

function SendMessageToPlayerChat(player, text)
	local rp = RecipientFilter()
	rp:AddPlayer(player)
 
	umsg.Start("inv_chatprintnormal", rp)
		umsg.String(text)
	umsg.End()
end

function SendWaveInfoToClient(timeleft, curwave, running, ended)
	local rp = RecipientFilter()
	rp:AddAllPlayers()
 
	umsg.Start("inv_clientwaveinfoupdate", rp)
		umsg.Float(curwave)
		umsg.Float(timeleft)
		umsg.Bool(running)
		umsg.Bool(ended)
	umsg.End()
end

function SendPowerCoreHealthToClient()
	rp = RecipientFilter()
	rp:AddAllPlayers()
	--print(1)

	if GameHasEnded == false then	
		--print(2)
		local PowerCoreHealth = ents.FindByClass("inv_powercore")[1].Entity:Health()
 
		umsg.Start("inv_clientpowercorehudupdate", rp)
			umsg.Float(PowerCoreHealth)
		umsg.End()
	else
		umsg.Start("inv_clientpowercorehudupdate", rp)
			umsg.Float(0)
		umsg.End()
	end
end
timer.Create( "inv_updateclientpowercorehud", 1, 0, SendPowerCoreHealthToClient)

function inv_showwaveinfo( player, command, arguments )
    print("Wave time left: " .. CurrentWaveTimeLeft)
	print("Wave          : " .. CurrentWave)
	print("Wave Running  : " .. tostring(WaveRunning))
	print("Game Ended    : " .. tostring(GameHasEnded))
end
concommand.Add( "inv_showwaveinfo", inv_showwaveinfo )


--[[function inv_resetstats( player, command, arguments )
    player:SetStats(INV_STARTLEVEL, INV_STARTXP, INV_STARTPOINTS, INV_STARTMONEY, INV_STARTWEAPONSPEED, INV_STARTWEAPONDAMAGE, INV_STARTSPEED, INV_STARTCLIPSIZE, INV_STARTMAXHEALTH, INV_STARTDAMAGETAKEN, INV_STARTBUYABLES, INV_STARTJUMP, INV_STARTSPREAD)
	DoPlayerLoadout(player)
	SendMessageToPlayerChat(player, "Your stats have been reset")
end
concommand.Add( "inv_resetstats", inv_resetstats )]]--


